<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>Document</title>
    </head>
    <body>
    </body>
    <script>
        // 变量-let
        let name = "xiao~"
        name = 19
        console.log(typeof(name))
        console.log(name)

        let age = 20
        age = "20"
        console.log(typeof(age))
        console.log(age)
        // 常量-const
        const sex = "male"
        // sex = "female"//报错
        console.log(typeof sex)//打印常量不加括号
        console.log(sex)

        // 常量定义列表，类，可以进行修改，但是不能赋值（本质内存地址没有改变）
        const arr = [0,1,2,3]
        // 添加
        arr.push(4)
        console.log(arr)
        // 删除
        arr.shift()
        console.log(arr)

        // 修改类
        const people = {
            name: "张三",
            age: 15
        }
        console.log(people)
        // 添加
        people.birth = 2015
        console.log(people)
        // 修改
        people.age = 20
        console.log(people)
    </script>
</html>